<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/blog/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta property="og:type" content="website">
<meta property="og:title" content="leveryd个人博客">
<meta property="og:url" content="https://looklook.gitee.io/page/4/index.html">
<meta property="og:site_name" content="leveryd个人博客">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="leveryd个人博客">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://looklook.gitee.io/page/4/">





  <title>leveryd个人博客</title>
  








</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left 
  page-home">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">leveryd个人博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/blog/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/blog/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/blog/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://looklook.gitee.io/blog/2019/02/02/openstack单节点环境搭建/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="leveryd">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/blog/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="leveryd个人博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/blog/2019/02/02/openstack单节点环境搭建/" itemprop="url">openstack单节点环境搭建</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-02-02T11:00:00+08:00">
                2019-02-02
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>本文记录在安装openstack单节点环境时踩过的一些坑</p>
<h1 id="搭建环境"><a href="#搭建环境" class="headerlink" title="搭建环境"></a>搭建环境</h1><h2 id="搭建方式"><a href="#搭建方式" class="headerlink" title="搭建方式"></a>搭建方式</h2><p>因为kolla比DevStack等方式要新一些，故最终选用kolla来安装。而kolla又分下面两种</p>
<ul>
<li>kolla-kubernetes (不如ansible成熟)</li>
<li>kolla-ansible</li>
</ul>
<p>只是入门，就选择使用单点部署</p>
<h2 id="系统环境"><a href="#系统环境" class="headerlink" title="系统环境"></a>系统环境</h2><p>ubuntu 14.04 安装测试</p>
<h2 id="步骤"><a href="#步骤" class="headerlink" title="步骤"></a>步骤</h2><p>主要根据参考中的<code>官方文档</code>来搭的环境，需要注意的是，<strong><em>kolla-ansible和kolla两个项目切到origin/stable/queens等稳定版本</em></strong></p>
<p>根据文档安装完成后，可以登陆<code>Horizon dashboard</code>、访问nova等api接口，但是创建虚机还是会报错，留作后面再排错。</p>
<h1 id="遇到的问题"><a href="#遇到的问题" class="headerlink" title="遇到的问题"></a>遇到的问题</h1><ol>
<li><p>build image卡住没有进度</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">解决方法：添加docker源</span><br><span class="line">/etc/docker/daemon.json</span><br><span class="line">&#123;&quot;registry-mirrors&quot;: [&quot;https://a5aghnme.mirror.aliyuncs.com&quot;]&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ERROR:kolla.common.utils.base:The command &apos;/bin/sh -c yum -y install centos-release-ceph-luminous centos-release-opstools centos-release-qemu-ev epel-release yum-plugin-priorities &amp;&amp; yum clean all &amp;&amp; rm -rf /var/cache/yum&apos; returned a non-zero code: 1</span><br></pre></td></tr></table></figure>
</li>
<li><p>docker-engine和docker.io冲突</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">解决方法：卸载docker.io</span><br><span class="line">yum remove docker.io docker-common</span><br></pre></td></tr></table></figure>
</li>
<li><p>找不到镜像</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">Tag 7.0.0 not found in repository docker.io/kolla/centos-binary-cron</span><br><span class="line"></span><br><span class="line">解决方法：修改globals.yml中的配置指定tag</span><br><span class="line"></span><br><span class="line">Dockerhub images are tagged as pike, master, etc. Please set:</span><br><span class="line">openstack_release: &quot;pike&quot; in your globals.yml</span><br></pre></td></tr></table></figure>
</li>
<li><p>报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Error starting daemon: error initializing graphdriver: \&quot;/var/lib/docker\&quot; contains several valid graphdrivers: devicemapper, overlay; Please cleanup or explicitly choose storage driver (-s &lt;DRIVER&gt;)</span><br><span class="line">到/var/lib/docker根据情况，将下面的overlay或者devicemapper文件夹删掉即可。这种情况发生在使用采用dc/os安装后，原有的devicemapper模式修改成了overlay，但是docker同时只能支持一种存储模式。</span><br><span class="line"></span><br><span class="line">不能删除/var/lib/docker/devicemapper 提示device busy时，可以umount /var/lib/docker/devicemapper后再删除</span><br></pre></td></tr></table></figure>
</li>
<li><p>Kolla-build: command not found</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install ./kolla</span><br></pre></td></tr></table></figure>
</li>
<li><p>报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://packagecloud.io/grafana/stable/el/7/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 302 - Found</span><br></pre></td></tr></table></figure>
</li>
<li><p>docker python库报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">load_config() got an unexpected keyword argument</span><br><span class="line"></span><br><span class="line">解决方法：不要按照官方文档安装python-docker-py</span><br><span class="line">pip install &apos;docker&gt;=2.6,&lt;3.0.0&apos;</span><br></pre></td></tr></table></figure>
</li>
<li><p>报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">pip install ./kolla时报错</span><br><span class="line">Failed to fetch https://packagecloud.io/rabbitmq/rabbitmq-server/ubuntu/dists/xenial/InRelease  Unable to connect to packagecloud-repositories.s3.dualstack.us-west-1.amazonaws.com:https:</span><br><span class="line">INFO:kolla.common.utils.zookeeper:W: Some index files failed to download. They have been ignored, or old ones used instead.</span><br><span class="line"></span><br><span class="line">解决办法：</span><br><span class="line">pip install ./kolla --ignore-installed PyYAML</span><br></pre></td></tr></table></figure>
</li>
<li><p>pip依赖不能重装</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Cannot uninstall &apos;PyYAML&apos;. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.</span><br></pre></td></tr></table></figure>
</li>
<li><p>部署中报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line">问题：</span><br><span class="line">The conditional check &apos;config_json.changed | bool or rabbitmq_confs.changed</span><br><span class="line"></span><br><span class="line">解决办法：kolla和kolla-ansible 都切到stable版本</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">fatal: [localhost]: FAILED! =&gt; &#123;&quot;msg&quot;: &quot;Unable to look up a name or access an attribute in template string (&#123;&#123; inventory_hostname in groups[&apos;neutron-metering-agent&apos;] &#125;&#125;).\nMake sure your variable name does not contain invalid characters like &apos;-&apos;: argument of type &apos;StrictUndefined&apos; is not iterable&quot;&#125;</span><br><span class="line"></span><br><span class="line">解决办法：</span><br><span class="line">直接禁用haproxy</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">failed: [localhost] (item=/usr/share/kolla-ansible/ansible/roles/haproxy/templates/haproxy.cfg.j2) =&gt; &#123;&quot;changed&quot;: false, &quot;item&quot;: &quot;/usr/share/kolla-ansible/ansible/roles/haproxy/templates/haproxy.cfg.j2&quot;, &quot;msg&quot;: &quot;AnsibleUndefinedVariable: &apos;dict object&apos; has no attribute &apos;glance-registry&apos;&quot;&#125;</span><br><span class="line"></span><br><span class="line">解决办法：直接禁用haproxy</span><br><span class="line">enable_haproxy: &quot;no&quot;</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">rabbitmq_monitoring_password&apos; is undefined&quot;</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.0.2:53: read udp 192.168.0.10:48758-&gt;192.168.0.2:53: i/o timeout\&quot;)\\n&apos;&quot;&#125;</span><br><span class="line"></span><br><span class="line">解决办法：</span><br><span class="line">修改/etc/hosts添加dns服务器:nameserver 8.8.8.8</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">只有一张物理网卡</span><br><span class="line"></span><br><span class="line">解决办法：</span><br><span class="line">ifconfig创建一个虚拟网卡</span><br><span class="line">ifconfig eth0:0 192.168.10.10 up</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">docker需要认证</span><br><span class="line"></span><br><span class="line">解决办法：</span><br><span class="line">docker login命令先登陆</span><br><span class="line"></span><br><span class="line">问题：</span><br><span class="line">TASK [neutron : Running Neutron bootstrap container] *************************** 卡住了</span><br></pre></td></tr></table></figure>
</li>
<li><p>部署前检查报错</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fatal: [localhost]: FAILED! =&gt; &#123;&quot;changed&quot;: false, &quot;cmd&quot;: [&quot;ip&quot;, &quot;-4&quot;, &quot;-o&quot;, &quot;addr&quot;, &quot;show&quot;, &quot;dev&quot;, &quot;eth0&quot;], &quot;delta&quot;: &quot;0:00:00.043125&quot;, &quot;end&quot;: &quot;2019-01-10 13:48:41.975511&quot;, &quot;failed_when_result&quot;: true, &quot;rc&quot;: 0, &quot;start&quot;: &quot;2019-01-10 13:48:41.932386&quot;, &quot;stderr&quot;: &quot;&quot;, &quot;stderr_lines&quot;: [], &quot;stdout&quot;: &quot;2: eth0    inet 192.168.16.88/20 brd 192.168.31.255 scope global noprefixroute eth0\\       valid_lft forever preferred_lft forever&quot;, &quot;stdout_lines&quot;: [&quot;2: eth0    inet 192.168.16.88/20 brd 192.168.31.255 scope global noprefixroute eth0\\       valid_lft forever preferred_lft forever&quot;]&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>登陆dabashboard提示证书不可用</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">原因：账号密码不正确</span><br><span class="line"></span><br><span class="line">账号默认是admin，密码在cat /etc/kolla/passwords.yml|grep -i keystone_admin</span><br></pre></td></tr></table></figure>
</li>
</ol>
<h1 id="tips"><a href="#tips" class="headerlink" title="tips"></a>tips</h1><ol>
<li>kolla-ansible和kolla项目切到稳定分支</li>
<li>如果在virtualbox中安装时，centos7镜像选择minimal。dvd版 4G+太大了</li>
<li>没有双网卡可以使用ifconfig虚拟一张网卡</li>
</ol>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><p><a href="!https://blog.csdn.net/Jmilk/article/details/80500234#%E6%A3%80%E9%AA%8C-%E4%BD%BF%E7%94%A8">Kolla 让 OpenStack 部署更贴心</a></p>
<p><a href="!https://cloud.tencent.com/developer/article/1073885">Docker 容器化部署运维 OpenStack 和 Ceph</a></p>
<p><a href="!https://docs.openstack.org/project-deploy-guide/kolla-ansible/ocata/">官方文档</a></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/blog/page/3/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/blog/">1</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/3/">3</a><span class="page-number current">4</span><a class="page-number" href="/blog/page/5/">5</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/8/">8</a><a class="extend next" rel="next" href="/blog/page/5/"><i class="fa fa-angle-right"></i></a>
  </nav>



          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">leveryd</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/blog/archives/">
              
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">2</span>
                  <span class="site-state-item-name">标签</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">leveryd</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/blog/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/blog/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=5.1.4"></script>



  
  

  

  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
